Skip to main content

popup

Type​

command

Summary​

Opens a widget within a popup window.

Syntax​

popup widget <kind> [at <location>] [with <properties>]

Description​

Use to display a widget within a popup window, for example as a tooltip or picker dialog.

The popup appears with its top left corner at the location. If no location is specified, the popup's top left corner is at the mouse location. While the popup widget is displayed, the handler pauses.

Parameters​

NameTypeDescription

kind

The unique identifier of the widget to use for the popup.

location

A point or expression that evaluates to a point. Two integers separated by a comma.

properties

An expression that evaluates to an array. For each key of the array, the popup widget will be initialized by setting that property to the value for that key.

Examples​

popup widget "com.livecode.widget.iconpicker" at the mouseloc
local sColor = "1,1,0.5"
on mouseDown theButton
-- pop up the colorpicker on right-click or control-click
if theButton is 3 then
local tProps
put "0,0,120,50" into tProps["rect"]
put sColor into tProps["initialColor"]
popup widget "com.example.mycolorpicker" with properties tProps
if the result is not "Cancel" then
put it into sColor
end if
else
pass mouseDown
end if
end mouseDown

Value​

NameTypeDescription

it

The popup widget command places the widget return value in the it variable.

the result

If the user dismisses the popup, the it variable is set to empty, and the result function returns "Cancel".

message: mouseDown, mouseUp

function: clickLoc, mouseLoc, result

keyword: popup, it

Compatibility and Support​

Introduced

LiveCode 8.0

OS

mac

windows

linux

Platforms

desktop

Thank you for your feedback!

Was this page helpful?